package studychinese.activity;

import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.hschinese.pronunciation.R;

import studychinese.model.CustomDialogl;
import studychinese.model.Tools;


public class AboutUsActivity extends BaseAcitivity implements View.OnClickListener {
  private RelativeLayout aboutUs_release;
  private RelativeLayout aboutUs_Mine;
  private RelativeLayout aboutUs_usage;
  private ImageView backabus;

    @Override
    protected int setContainer()
    {
        return R.layout.activity_about_us;
    }

    @Override
    public void innitView()
    {
        aboutUs_release = (RelativeLayout) findViewById(R.id.rl_aboutus_release);
        aboutUs_Mine = (RelativeLayout) findViewById(R.id.rl_aboutus_mine);
        aboutUs_usage = (RelativeLayout) findViewById(R.id.rl_aboutus_usage);
        backabus = (ImageView) findViewById(R.id.iv_aboutus_back);
        backabus.setOnClickListener(this);
        aboutUs_release.setOnClickListener(this);
        aboutUs_Mine.setOnClickListener(this);
        aboutUs_usage.setOnClickListener(this);
    }

    @Override
    public void onClick(View v)
    {
        switch (v.getId())
        {
            case R.id.rl_aboutus_release:
                // 获取本版本号，是否更新
                int vision = Tools.getVersion(this);
                /*
                版本一致的时候提示用户
                 */
               if (vision!=0)
               {
                   final CustomDialogl dialog=new CustomDialogl(this, R.style.mystyle, R.layout.release_dialog_layout);
                   View inflate = LayoutInflater.from(AboutUsActivity.this).inflate(R.layout.release_dialog_layout, null);
                   Button confinrm = (Button) inflate.findViewById(R.id.relese_confirm_btn);
                   confinrm.setOnClickListener(new View.OnClickListener() {
                       @Override
                       public void onClick(View v)
                       {
                           dialog.dismiss();
                       }
                   });
                   dialog.show();
               }
                break;
            case R.id.rl_aboutus_mine:

                break;
            case R.id.rl_aboutus_usage:
                break;
            case R.id.iv_aboutus_back:
                finish();
                break;
        }
    }
}
